<div id="index" class="container" style="padding-top: 20px;">
   <div class="row">
      <div class="col-md-12 mt-3">
         <admin-page-welcome title="欢迎光临"> 
            <p>上一次登陆时间：2021-01-01 12:00:00，IP: 127.0.0.1,区域: 北京</p>
             未设置欢迎公告
         </admin-page-welcome>
      </div>
      <div class="col-md-12 mt-3" >
        <h5 class="mt-2">应用程序</h5>
        <div class="app-list">
            <template v-for="app in apps" :key="app.name">
            <div class="app-item shadow-sm" v-if="app.name!='admin'" @click="appHandleClick(app)" >
                <bi-picture :src="app.icon" :width="100" :height="100" ></bi-picture>
                <div class="app-title">{{app.title}}</div>
            </div>
            </template>
        </div>

        <h5 class="mt-3">最后操作，收藏夹，等等</h5>
        
       


      </div>
   </div>
</div>

<script>

let app = admin.createApp({
    data(){
        
        let apps = this.$user.getLocalStorage('appList');
    
        return {
            apps,
            loading:false
        }
    },
    methods:{
        appHandleClick(item){
            if (item.admin_url) location.href = item.admin_url;
        }
    },
}).mount('#index');

</script>

<style>
.app-list{
    display: grid;
    padding: 10px 0;
    grid-template-columns: repeat(auto-fill,120px);
    grid-gap: 15px;
}

.app-list .app-item{
    text-align: center;
    cursor: pointer;
    width: 120px;
    background-color: #FFF;
    border-radius: 5px;
    padding: 10px;
}


.app-list .app-item:hover{
    background-color: var(--bs-secondary-bg);
}
</style>